<template>
  <div class="base">
      <div class="baseNavBar">
          <van-nav-bar title="基地" @click-left="goback" left-arrow>
          </van-nav-bar>
      </div>
      <div class="baseInfo" v-for="(base,pro) in baseinfo" :key="pro">
          <div class="baseLeft">
              <img :src="base.businessLogo">
          </div>
          <div class="baseRight">
              <div class="baseHand">
                  <span class="baseTitle">{{base.businessName}}</span>
                  <span class="baseAuict">{{base.authGrade}}级认证</span>
              </div>
              <div class="baseSaleshop">
                  <span>{{base.shop}}</span>
              </div>
          </div>
          <div class="baseBtn">
              <van-button color="#FF6200">在线沟通</van-button>
          </div>
      </div>
      <div class="baseShop">
          <groupGoods :groupGoods="groupGoods">
          </groupGoods>
      </div>
  </div>
</template>

<script>
import groupGoods from "../../components/groupGoods";
import { shoppingService } from "@/api";
export default {
    name: "base",
    data(){
        return{
            baseinfo:[],
            groupGoods: [],
                }
            },
            created(){
                this.asgetSupplier();
            },
            methods:{
                goback(){
                    this.$router.go(-1);
                },
     // 获取基地
      async asgetSupplier() {
      const { data } = await shoppingService.getSupplier(2,1,10);
      console.log(data, "基地");
      this.baseinfo = data.list;
      this.groupGoods = data.list[0].productList;
      console.log(this.groupGoods,"???");
    },
            },
            components:{
                groupGoods,
            }
}
</script>

<style scoped>
.baseInfo{
    display: flex;
    margin-top: 20px;
    margin-left: 13px;
}
.baseLeft{

}
.baseLeft img{
    width: 45px;
    height: 45px;
    border-radius: 25px;
}
.baseRight{

}
.baseHand{
    margin-left: 10px;
}
.baseTitle{
    font-size:14px;
    font-family:PingFang SC;
    font-weight:bold;
    color:rgba(51,51,51,1);
    line-height:20px;
}
.baseAuict{
    border-radius:5px 0px 5px 0px;
    background-color: #fff0e6;
    color: #FF6200;
    font-size: 10px;
}
.baseSaleshop{
    margin-left: 10px;
    margin-top: 5px;
}
.baseSaleshop span{
    font-size:10px;
    font-family:PingFang SC;
    font-weight:500;
    color:rgba(153,153,153,1);
    line-height:20px;
}
.baseBtn{
    margin-left: 83px;
    text-align: right;
    vertical-align: middle;
}
.baseBtn button{
    width:90px;
    height:30px;
    border-radius:3px;
    margin-top: 10px;
}
.baseShop{
    background:rgba(247,249,252,1);
}
</style>